package com.nineclock.sign.controller;

import com.nineclock.common.entity.Result;
import com.nineclock.sign.SysSignApi;
import com.nineclock.sign.dto.SignDTO;
import com.nineclock.sign.service.SignClockINService;
import org.checkerframework.checker.units.qual.C;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/sign")
public class signclock implements SysSignApi {
    @Autowired
    SignClockINService signClockINService;

    @Override
    @PostMapping("/insert")
    public Result signClockIn(SignDTO signDTO) {

        signClockINService.singClockInInsert(signDTO);

        return Result.success();
    }

    //查看所有员工指定日期签到列表
    @GetMapping("/pagingSignCurrentUserByMonth")
    @Override
    public Result<List<SignDTO>> SignCurrentUserByMonth(
         String dateStr
    ) {
        List<SignDTO> signDTOS = signClockINService.SignCurrentUserByMonth(dateStr);
        return Result.success(signDTOS);
    }

    @Override
    public Result<List<SignDTO>> listSifnAllUser() {
        return null;
    }
}
